<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title>客户列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
    </style>
  </head>
  
  <body>

    <div class="x-body x-admin">
        
      <xblock>
        <a href="javascript:;" class="layui-btn layui-btn-normal" id="gotoStep2">同步全部选手</a>
        <!--<a href="javascript:;" class="layui-btn layui-btn-danger" id="gotoStep3">同步全部选手</a>-->
      </xblock>
      <div class="layui-table-body layui-table-main" style="width: 100%;">
      <table class="layui-table layui-form">
        <thead>
          <tr>
            <th>序号</th>
            <th>机构名</th>
            <th>选手编号</th>
            <th>选手</th>
            <th>任务名</th>
            <th>状态</th>
            <th>照片</th>
        </thead>
        <tbody>
          {volist name="list" id="v" key="k"}
          <tr>
            <td>{$k}</td>
            <td>{$v.team_name}</td>
            <td>{$v.sort}</td>
            <td>{$v.name}</td>
            <td>{$v.task_name}</td>
            <td>{$v.status==1?'已同步':'未同步'}</td>
            <td>{volist name=":json_decode($v.photos,true)" id="vv"}<a href="{$vv}" target="_blank"><img src="{$vv}" style="max-height:50px"></a>{/volist}</td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
      
    </div>

    <script>
      layui.use(['form','layer','jquery'], function(){
        var form = layui.form,
        $ = layui.jquery,
        layer = layui.layer;
        $('#gotoStep2').click(function(){
            layer.load(2, {
              shade: [0.5,'#ccc']
            });
            $.get('batchUploadVoteStep3?task_name={$list[0]['task_name']}',function(data){
                if(data['code'] == 1){
                    alert('同步完成');
                    window.location.reload();
                }
            },'json')
        })
        
      });

    </script>
  </body>

</html>